<div class="container" style="margin-top: 50px">
    <form class="form-horizontal well" action="#" method="post">        
        <fieldset>
            <legend>
                <?php echo $this->titulo; ?>
                <button id="novo_aluno" style="float: right; margin-top: 2px" class="btn btn-primary" type="button">Novo Aluno</button>
            </legend>
            <!-- INICIO dos campos de busca -->
            <div class="form-actions" style="padding-left: 20px!important; margin-top: 0px">
                <div style="margin-left: 121px; margin-bottom: 30px">
                    <label style="display: inline-block; margin-right: 14px" for="aluno-tx_nome_aluno">Nome</label>
                    <input class="input-prepend required" style="margin-right: 25px" type="text" name="aluno[tx_nome_aluno]" id="aluno-tx_nome_aluno" maxlength="45"/>
                    <label style="display: inline-block; margin-right: 10px" for="aluno-tx_cpf">CPF</label>
                    <input class="input-prepend cpf validarCPF" style="margin-right: 25px" type="text" name="aluno[tx_cpf]" id="aluno-tx_cpf" maxlength="14"/>
                </div>
                <div style="margin-bottom: -20px; margin-top: -20px" class="form-actions">
                    <input class="btn btn-primary" id="btBuscarAluno" type="button" value="Buscar"/>
                </div>
            </div>
            <!-- FIM dos campos de busca -->            
        </fieldset>

        <div id="divResAluno"></div>
    </form>


</div>

<script>
    $(function(){                                             
        $('#divResAluno').load('<?php echo $this->baseUrl('admin/aluno/grid'); ?>');
        $('#btBuscarAluno').click(function(){            
            tx_nome_aluno = urlencodeGet($('#aluno-tx_nome_aluno').val());            
            tx_cpf = urlencodeGet($('#aluno-tx_cpf').val());                        
            
            $('#divResAluno').load('<?php echo $this->baseUrl('admin/aluno/grid'); ?>'+'/tx_nome_aluno/' + tx_nome_aluno + '/tx_cpf/' + tx_cpf);
        });
        
        //Carrega formulario de novo aluno com jquery
        $('#novo_aluno').click(function(){
            window.location = '<?php echo $this->baseUrl('/admin/aluno/form') ?>';
        });
    }); 
    
</script>